<template>
  <div class="m-geo">
    <i class="el-icon-location"/>
    {{province}}
    <nuxt-link class="changeCity" to="/changeCity">切换城市</nuxt-link>[香河 廊坊 天津]
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      province: "",
      city: ""
    };
  },
  async created() {
    const {
      status,
      data: { province, city }
    } = await axios.get("http://localhost:3000/geo/getPosition");
    if (status === 200) {
      this.province = province;
      this.city = city;
    }
  }
};
</script>

<style lang="css">
</style>  
